package com.example.shareprefence;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity3 extends AppCompatActivity {

    Button button5;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main3);
        button5 = findViewById(R.id.button5);
    }
    public void jumpFirst(View view){
        Intent intent = new Intent(MainActivity3.this,MainActivity.class);
        startActivity(intent);
    }

    public void get(View view){
        SharedPreferences sharedPreferences = getSharedPreferences("data",MODE_PRIVATE);
        String str = sharedPreferences.getString("asd"," ");
        Toast.makeText(this, str, Toast.LENGTH_SHORT).show();
    }
}